<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFiledsIntoProducts extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->unsignedBigInteger('font_id')->after('team_id')->default(0);

            $table->string('height')->after('img')->nullable();
            $table->string('weight')->after('height')->nullable();
            $table->string('cup')->after('weight')->nullable();

            $table->string('photo')->after('cup')->nullable();
            $table->json('atlas')->nullable()->after('photo');

            $table->string('name_map')->after('atlas')->nullable();
            $table->string('name_map_rotate')->after('name_map')->nullable();
            $table->string('name_map_position')->after('name_map_rotate')->nullable();
            $table->string('name_class')->after('name_map_position')->nullable();
            $table->string('three_map')->after('name_map_position')->nullable();
            $table->string('three_map_rotate')->after('three_map')->nullable();
            $table->string('three_map_position')->after('three_map_rotate')->nullable();
            $table->string('three_separator')->after('three_map_position')->default(' ');
            $table->string('three_class')->after('three_separator')->nullable();

            $table->string('video')->after('three_separator')->nullable();
            $table->string('video_cover')->after('video')->nullable();
            $table->string('audio')->after('video_cover')->nullable();
            $table->string('audio_duration')->after('audio')->nullable();

            $table->tinyInteger('source')->after('status')->default(0);



        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn([
                'height','weight','cup','name_map','name_map_rotate','three_map','three_map_rotate','name_map_position','three_map_position','three_separator','photo','atlas','video','video_cover','audio','audio_duration','source'
            ]);
        });
    }
}
